<!--
  @author heguanghua
  @since 2020/04/24 14:12
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common::jscss"/>
<body>

<div class="layui-fluid"
     th:with="hasAddEdit=${#authPermit.checkPermit('/organize/modify/addEdit.action')},
     hasModifyStatus=${#authPermit.checkPermit('/organize/modify/modifyStatus.action')}">

    <blockquote class="layui-crumb">
        <a lay-href="/organize/tree.action" lay-text="组织架构">组织架构管理</a>
    </blockquote>

    <div class="layui-card">

        <div class="layui-split">&nbsp;</div>

        <form method="post" class="layui-form" lay-filter="zmn-form-filter"  action="/organize/tree.action">
            <div class="layui-form" th:include="organize/_query :: query "></div>
        </form>

        <div class="layui-card-body">

            <div class="layui-btn-container">
                <div class="layui-btn-group" th:if="${hasModifyStatus}">
                    <button class="layui-btn layui-btn-sm" onclick="setStatus(2);">启用</button>
                    <button class="layui-btn layui-btn-sm" onclick="setStatus(1);">停用</button>
                </div>
                <!--<div class="layui-btn-group">
                    <a lay-href="/organize/detail.action" class="layui-btn layui-btn-sm layui-btn-primary" lay-text="组织信息" text="新增组织">+新增组织</a>
                </div>-->
            </div>

            <table class="layui-hide" id="zmn-table" lay-filter="zmn-table"></table>

        </div>

    </div>

</div>
</body>
</html>

<script type="text/javascript" th:inline="javascript">

    var json = {
        orgId: [[${vo.parentId == null ? 0: vo.parentId}]],
        hasDetail: [[${#authPermit.checkPermit('/organize/detail.action')}]],
        hasDeptList: [[${#authPermit.checkPermit('/dept/tree.action')}]],
        hasAddEdit: [[${#authPermit.checkPermit('/organize/modify/addEdit.action')}]],
        hasModifySort: [[${#authPermit.checkPermit('/organize/modify/modifySort.action')}]],
        vo: [[${vo}]]
    };

    layui.extend({
        organize_tree: "organize/zmn.organize.tree"
    }).use(['index', 'organize_tree']);

</script>
